<template>
    <fieldset>
        <legend>actions</legend>
        <h1>{{$store.getters.reverseMsg}}</h1>
        <h1> {{reverseMsg}} </h1>
        <h1> {{msg}} </h1>
        <ul>
            <li v-for="item in products" :key="item.id">
                {{item.title}}
            </li>
        </ul>
    </fieldset>
</template>

<script>
import {mapActions,mapState,mapGetters} from 'vuex'
export default{
    data(){
        return{

        }
    },
    computed:{
        ...mapState(['products','msg']),
        ...mapGetters(['reverseMsg'])
    },
    methods:{
        ...mapActions(['GET_PRODUCTS'])
    },
    mounted(){
        // this.$store.dispatch("GET_PRODUCTS",555)
        this.GET_PRODUCTS(555)
        // this.$store.state.msg='挑战严格模式'
    }
}
</script>
